import {Dialog, Button} from "@taroify/core";

const SubmitModal: React.FC<{
    open: boolean,
    title: string,
    child: React.ReactNode,
    onClose: () => void,
    onOk: () => void,
}> = ({open, title, child, onClose, onOk}) => {
    return (<Dialog open={open}>
        <Dialog.Header>{title}</Dialog.Header>
        <Dialog.Content>
            {child}
        </Dialog.Content>
        <Dialog.Actions>
            <Button onClick={onClose}>取消</Button>
            <Button onClick={onOk}>确认</Button>
        </Dialog.Actions>
    </Dialog>)
}

export default SubmitModal